package cn.toutatis.sandbox.root.security.service.mapper;


import cn.toutatis.sandbox.root.security.authEntity.AccountEntity;
import cn.toutatis.sandbox.root.security.service.entity.SystemUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* <p>
    * 必要用户表 Mapper 接口
    * </p>
*
* @author Toutatis_Gc
* @since 2020-08-13
*/
@Mapper
@Repository
public interface SystemUserMapper extends BaseMapper<SystemUser> {

    @Select("SELECT * FROM SYSTEM_USER WHERE account = #{identity} OR tel = 'identity' OR email = 'identity' LIMIT 1")
    AccountEntity getUser(@Param("identity") String identity);
}
